home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / toolbox / www / cgi-bin / DTsearch-cgi < prev    next >
Encoding:
Text File  |  1996-11-11  |  4.5 KB  |  129 lines

  1. #!/usr/sbin/perl
  2. # $Id: DTsearch-cgi.m,v 1.6 1996/10/29 21:28:14 murphy Exp $
  3. #
  4. # DTsearch - build a search form for the Developer Toolbox
  5. #
  6. # $Log: DTsearch-cgi.m,v $
  7. # Revision 1.6  1996/10/29  21:28:14  murphy
  8. # changes necessary to support forum 96 CD
  9. #
  10. # Revision 1.5  1996/04/24  18:18:28  dave
  11. # cleaning up DTsearch header presentation
  12. #
  13. # Revision 1.4  1996/04/22  13:38:27  DTjanitor
  14. # change .www references to .www_6.0
  15. #
  16. # Revision 1.3  1996/02/21  21:54:43  dave
  17. # removed Oasis from titles of this page
  18. #
  19. # Revision 1.1  1996/02/15  19:47:49  dave
  20. # adding in collapsed cgi-bin{int,ext,cd} files into their .m new forms
  21. #
  22. # Revision 1.7  1995/05/01  15:52:40  dave
  23. # updating to escape ALL quoted @ signs as dan said perl 5 needs since reality results are in, as well as changing all occurences of dave@sgi.com with DTjanitor@sgi.com
  24. #
  25. # Revision 1.6  1995/03/11  00:38:18  dave
  26. # not finished but need to check these in to test 'em at work
  27. #
  28. # Revision 1.5  1995/02/22  17:17:44  dave
  29. # replaced old DTtopical.html with correct DTtopic.html href
  30. #
  31. # Revision 1.3  1995/02/16  17:52:42  dave
  32. # modified to refer to cgi-lib.pl locally & added cgi-lib.pl local copy
  33. #
  34. # Revision 1.2  1995/02/15  23:23:36  dave
  35. # updating incorrect html syntax and robustifying the code
  36. #
  37. #
  38.  
  39. $debug=0;
  40.  
  41. #get user home directory from this file
  42. eval (`cat "/tmp/.userhome_$ENV{'SERVER_PORT'}"`);
  43.  
  44. # make the $userHome/.www_6.0/.DT_DocRootFile, specified below, have it's contents
  45. # equal to the equivalent on your machine of everything inside the single
  46. # "'" quotes:  '$DocumentRoot="/AbsPath/to/your/DocRoot"'
  47. $DocumentRoot=$ENV{'DOCUMENT_ROOT'};
  48. $DocumentRoot="/usr/netsite-docs" unless $DocumentRoot;
  49.  
  50. $MoasisRoot = "$DocumentRoot/toolbox/searchtools";
  51. $ENV{'FULPATH'} = $MoasisRoot;
  52.  
  53. require('cgi-lib.pl') || die "can\'t require cgi-lib.pl: $!";
  54.  
  55. open(CONFIG,"<$MoasisRoot/DTindex.conf") || die "$0: can\'t open config file $MoasisRoot/DTindex.conf: $!\n";
  56. @config = <CONFIG>;
  57. close(CONFIG);
  58.  
  59. print &PrintHeader;
  60.  
  61. print "<HTML>\n";
  62. print "<HEAD>\n";
  63. print "<TITLE>Developer Toolbox Search Engine Form</TITLE>\n";
  64. print "<LINK REV=\"made\" HREF=\"mailto:DTjanitor\@sgi.com\">\n";
  65. print "</HEAD>\n";
  66. print "<BODY>\n";
  67.  
  68. print "<h1><center>Developer Toolbox Search Engine</center></h1>"; 
  69. print "<h3><center><a href=\"/toolbox/DT.html\">HUB</a> |";
  70. print "<a href=\"/toolbox/www/cgi-bin/pheedbak-cgi/toolbox/www/cgi-bin?DTsearch-cgi\">Pheedbak</a> | ";
  71. print "<a href=\"/toolbox/DTtree.html\">Tree</a> | ";
  72. print "<a href=\"/toolbox/DTtopic.html\">Topic</a> | ";
  73. print "<a href=\"/toolbox/DTalfabetic.html\">A-Z</a> | ";
  74. print "<a href=\"/toolbox/DThot.html\">Hot</a> | ";
  75. print "<a href=\"/toolbox/DTnew.html\">New</a> | ";
  76. print "<a href=\"/toolbox/DTfaqs.html\">FAQs</a> | ";
  77. print "<a href=\"/toolbox/DTjumpdoors.html\">Jumpdoors</a></center></h3>";
  78.  
  79. print "<FORM METHOD=\"POST\" ACTION=\"/toolbox/www/cgi-bin/osearch-cgi\">\n";
  80. print " <HR size=\"4\">\n";
  81. print "  <B>Select the area(s) of the Toolbox you wish to search:</B> <EM>(you must select at least one)</EM><BR>\n\n";
  82.  
  83. print "  <DL>\n";
  84.  
  85. $item = 1;
  86. foreach $_ (@config) {
  87.     next        if (/^#/);      # Skip comments
  88.  
  89.     ($subset,$name,$desc) = split(':');
  90.     if ($item == 1) {
  91.         print "    <DD> <INPUT TYPE=\"checkbox\" NAME=\"subset\" VALUE=\"$subset\" checked";
  92.     } else {
  93.     print "    <DD> <INPUT TYPE=\"checkbox\" NAME=\"subset\" VALUE=\"$subset\"";
  94.     }
  95.     print " checked "    if ($ENV{'PATH_INFO'} =~ /$subset/);
  96.     print "> $name <EM>($desc)</EM>\n";
  97.     print "    <BR>\n";
  98.  
  99.     if ($item == 1) {
  100.         print "<hr size=\"4\">";
  101.     $item++;
  102.     }
  103.  
  104. }
  105.  
  106. print "  </DL>\n";
  107.  
  108. print "  <HR>\n";
  109. print "  <B>Enter search text:</B> <EM>(you may search document contents, and/or document titles)</EM><BR>\n";
  110. print "  <P>\n";
  111. print "  <UL>\n";
  112. print "    <LI>Search contents for: <INPUT TYPE=\"text\" NAME=\"keywords\" SIZE=\"30\" VALUE=\"\"> \n";
  113. print "    <LI>Search title for: <INPUT TYPE=\"text\" NAME=\"doctitle\" SIZE=\"30\" VALUE=\"\"> \n";
  114. print "  </UL>\n";
  115. print "  <INPUT TYPE=\"submit\" VALUE=\"Search\">\n";
  116. print "  <INPUT TYPE=\"reset\"  VALUE=\"Clear\">\n\n";
  117.  
  118. print "  <INPUT TYPE=\"hidden\" NAME=\"debug\" VALUE=\"0\">\n";
  119. print "</FORM>\n\n";
  120. print "<HR>\n";
  121.  
  122. print "please send any-and-all <A HREF=\"/toolbox/www/cgi-bin/pheedbak-cgi/toolbox/www/cgi-bin?DTsearch-cgi\">pheeedbak/comments/ideas</a> to the toolbox janitor.\n";
  123. print "<H6> <A HREF=\"/toolbox/sgi_info.html\">Copyright © 1995 Silicon Graphics, Inc.</A> </H6>\n\n";
  124.  
  125. print "</BODY>\n";
  126. print "</HTML>\n";
  127.  
  128.  
  129.